<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateUserTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.CreateUserLabel_idUser}" for="idUser" />
                    <h:inputText id="idUser" value="#{userController.selected.idUser}" title="#{bundle.CreateUserTitle_idUser}" required="true" requiredMessage="#{bundle.CreateUserRequiredMessage_idUser}"/>
                    <h:outputLabel value="#{bundle.CreateUserLabel_EMail}" for="EMail" />
                    <h:inputText id="EMail" value="#{userController.selected.EMail}" title="#{bundle.CreateUserTitle_EMail}" required="true" requiredMessage="#{bundle.CreateUserRequiredMessage_EMail}"/>
                    <h:outputLabel value="#{bundle.CreateUserLabel_name}" for="name" />
                    <h:inputText id="name" value="#{userController.selected.name}" title="#{bundle.CreateUserTitle_name}" />
                    <h:outputLabel value="#{bundle.CreateUserLabel_surname}" for="surname" />
                    <h:inputText id="surname" value="#{userController.selected.surname}" title="#{bundle.CreateUserTitle_surname}" />
                    <h:outputLabel value="#{bundle.CreateUserLabel_indexNumber}" for="indexNumber" />
                    <h:inputText id="indexNumber" value="#{userController.selected.indexNumber}" title="#{bundle.CreateUserTitle_indexNumber}" />
                    <h:outputLabel value="#{bundle.CreateUserLabel_description}" for="description" />
                    <h:inputText id="description" value="#{userController.selected.description}" title="#{bundle.CreateUserTitle_description}" />
                    <h:outputLabel value="#{bundle.CreateUserLabel_title}" for="title" />
                    <h:inputText id="title" value="#{userController.selected.title}" title="#{bundle.CreateUserTitle_title}" />
                    <h:outputLabel value="#{bundle.CreateUserLabel_rating}" for="rating" />
                    <h:inputText id="rating" value="#{userController.selected.rating}" title="#{bundle.CreateUserTitle_rating}" />
                    <h:outputLabel value="#{bundle.CreateUserLabel_active}" for="active" />
                    <h:inputText id="active" value="#{userController.selected.active}" title="#{bundle.CreateUserTitle_active}" />
                    <h:outputLabel value="#{bundle.CreateUserLabel_accountCreateYear}" for="accountCreateYear" />
                    <h:inputText id="accountCreateYear" value="#{userController.selected.accountCreateYear}" title="#{bundle.CreateUserTitle_accountCreateYear}" />
                    <h:outputLabel value="#{bundle.CreateUserLabel_fkUserRole}" for="fkUserRole" />
                    <h:selectOneMenu id="fkUserRole" value="#{userController.selected.fkUserRole}" title="#{bundle.CreateUserTitle_fkUserRole}" required="true" requiredMessage="#{bundle.CreateUserRequiredMessage_fkUserRole}">
                        <f:selectItems value="#{userRoleController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.CreateUserLabel_fkInstitute}" for="fkInstitute" />
                    <h:selectOneMenu id="fkInstitute" value="#{userController.selected.fkInstitute}" title="#{bundle.CreateUserTitle_fkInstitute}" required="true" requiredMessage="#{bundle.CreateUserRequiredMessage_fkInstitute}">
                        <f:selectItems value="#{instituteController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.CreateUserLabel_fkGroup}" for="fkGroup" />
                    <h:selectOneMenu id="fkGroup" value="#{userController.selected.fkGroup}" title="#{bundle.CreateUserTitle_fkGroup}" required="true" requiredMessage="#{bundle.CreateUserRequiredMessage_fkGroup}">
                        <f:selectItems value="#{group1Controller.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <br />
                <h:commandLink action="#{userController.create}" value="#{bundle.CreateUserSaveLink}" />
                <br />
                <br />
                <h:commandLink action="#{userController.prepareList}" value="#{bundle.CreateUserShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:link outcome="/index" value="#{bundle.CreateUserIndexLink}"/>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
